package com.dada.domain.exception;

import com.dada.domain.common.Code;
import lombok.Getter;

public class ApiException extends RuntimeException {

    @Getter
    private int code;

    public ApiException(Code code) {
        super(code.getMessage());

        this.code = code.getCode();
    }

    public ApiException(Code code, Throwable cause) {
        super(cause);

        this.code = code.getCode();
    }

    public ApiException(Code code, String message) {
        super(message);

        this.code = code.getCode();
    }

    public ApiException(Code code, String message, Throwable cause) {
        super(message, cause);

        this.code = code.getCode();
    }

}